//
//  BSNode.m
//  Spriter_forCocs2d
//
//  Created by Yang Bean on 13/4/23.
//
//
//
//#import "BSNode.h"
//#import "BSXMLPaser.h"
//#import "BSSpriterData.h"
//#import "BSTimeLine.h"
//#import "BSAnimation.h"
//#import "BSObject.h"
//#import "BSFolder.h"
//#import "BSFile.h"
//#import "BSMainLine.h"
//@implementation BSNode
//+ (id)BSNodeWithSpriteData:(BSSpriterData*)spriterData
//{
//    return [[[BSNode alloc] initWithSpriteData:spriterData] autorelease];
//}
//- (id)initWithSpriteData:(BSSpriterData*)spriterData
//{
//    self = [super init];
//    if (self) {
//        m_spriterData = [spriterData retain];
//        m_sprites = nil;
//    }
//    return self;
//}
//- (float)playAnimationWithName:(NSString*)name isRepeat:(BOOL)isRepeat
//{
//    [self clearSprite];
//    BSAnimation* animation = [m_spriterData animationWithAnimationName:name];
//    m_sprites = [[m_spriterData spriteArrayWithAniamtion:animation] retain];
//    for (int i = 0; i < [m_sprites count]; i++)
//    {
//        
//        CCSprite* s = [m_sprites objectAtIndex:i];
//        int z = [m_spriterData zOrderWithKeyId:0 timelineID:s.tag inMainLine:animation.mainline];
//        [self addChild:s z:z];
//        [m_spriterData setAnimation:animation
//                     toTimeLineId:s.tag
//                           sprite:s isRepeat:isRepeat];
//    }
//    return (float)animation.length / 1000;
//}
//- (void)clearSprite
//{
//    if (m_sprites) {
//        for (int i = 0; i < [m_sprites count]; i++) {
//            CCSprite* s = [m_sprites objectAtIndex:i];
//            [s stopAllActions];
//            [self removeChild:s cleanup:YES];
//        }
//        [m_sprites release];
//    }
//}
//- (void)dealloc
//{
//    [m_spriterData release];
//    [super dealloc];
//}
//@end
